package com.zj.joke;

import android.app.Application;
import com.activeandroid.ActiveAndroid;
import com.zj.joke.db.DBItem;
import com.zj.joke.util.DBUtils;

public class JokeApp extends Application {
	private static JokeApp mInstance = null;
	private boolean isInitDataMode = false;

	public static JokeApp getInstance() {
		return mInstance;
	}

	public void onCreate() {
		super.onCreate();
		mInstance = this;
		ActiveAndroid.initialize(this);
		if (!isInitDataMode) {
			DBUtils.copyDB(this);
		}
	}

	public boolean isInitDataMode() {
		return isInitDataMode;
	}

	public void setInitDataMode(boolean isInitDataMode) {
		this.isInitDataMode = isInitDataMode;
	}

	public void onTerminate() {
		super.onTerminate();
		ActiveAndroid.dispose();
	}
}